import { createRouter, type RouteRecordRaw, createWebHashHistory } from 'vue-router'

const routes: Array<RouteRecordRaw> = [
  {
    path: '/',
    name: '登录',
    component: () => import('../views/loginView.vue')
  },
  {
    path: '/home',
    name: '主页',
    component: () => import('../views/homeView.vue'),
    children: [
      {
        path: '/projectManage',
        name: '项目管理',
        component: () => import('../views/projectManage/index.vue')
      },
      {
        path: '/configManage',
        name: '组态配置管理',
        component: () => import('../views/configManage/index.vue')
      },
    ]
  },
  {
    path: '/Index',
    name: 'Index',
    component: () => import('../views/Index.vue')
  },
  {
    path: '/Preview',
    name: 'Preview',
    component: () => import('../views/Preview.vue')
  },
  {
    path: '/Editor',
    name: 'Editor',
    component: () => import('../views/Editor.vue')
  },
]


const router = createRouter({
  history: createWebHashHistory(import.meta.env.BASE_URL),
  routes
});

export default router;